class Record {
    constructor({
      id,
      Job_name:JobName,
      Job_id:JobId,
      company_name:companyName,
      company_id:companyId,
      user_name:userName,
      user_id:userId,
      student_id:studentId,
      status,
      reply,
      created_date: createdDate,
      updated_date: updatedDate,
    }) {
      this.record = {
        id: String,
        Job_name:String,
        Job_id:String,
        company_name:String,
        company_id:String,
        user_name:String,
        user_id:String,
        student_id:String,
        status: Number,
        reply:String,
        created_date: Number,
        updated_date: Number,
      }
      this.record.id = id
      this.record.Job_name = JobName
      this.record.Job_id = JobId
      this.record.company_name = companyName
      this.record.company_id = companyId
      this.record.user_name = userName
      this.record.user_id = userId
      this.record.student_id = studentId
      this.record.status = status
      this.record.reply = reply
      this.record.created_date = createdDate
      this.record.updated_date = updatedDate
    }
  
    getData() {
      const { record } = this
      const recordWithNoNull = { ...this.record }
  
      const properties = Object.getOwnPropertyNames(this.record)
  
      properties.forEach((property) => {
        if (Reflect.get(this.record, property) == null) {
          Reflect.deleteProperty(recordWithNoNull, property)
        }
      })
  
      return { record, recordWithNoNull }
    }
  
    get id() {
      return this.record.id === undefined ? null : this.record.id
    }
  
    set id(value) {
      this.record.id = value
    }

    get JobName() {
        return this.record.Job_name === undefined ? null : this.record.Job_name
      }
    
    set JobName(value) {
        this.record.Job_name = value
    }

    get JobId() {
        return this.record.Job_id === undefined ? null : this.record.Job_id
    }
    
    set JobId(value) {
        this.record.Job_id = value
    }

    get companyName() {
        return this.record.company_name === undefined ? null : this.record.company_name
    }
    
    set companyName(value) {
        this.record.company_name = value
    }

    get companyId() {
        return this.record.company_id === undefined ? null : this.record.company_id
      }
    
    set companyId(value) {
        this.record.company_id = value
    }

    get userName() {
        return this.record.user_name === undefined ? null : this.record.user_name
      }
    
    set userName(value) {
        this.record.user_name = value
    }

    get userId() {
        return this.record.user_id === undefined ? null : this.record.user_id
      }
    
    set userId(value) {
        this.record.user_id = value
    }

    get studentId() {
        return this.record.student_id === undefined ? null : this.record.student_id
    }
    
    set studentId(value) {
        this.record.student_id = value
    }

    get status() {
        return this.record.status === undefined ? null : this.record.status
      }
    
    set status(value) {
        this.record.status = value
    }

    get reply() {
      return this.record.reply === undefined ? null : this.record.reply
    }
  
    set reply(value) {
      this.record.reply = value
    }

    get createdDate() {
      return this.record.created_date === undefined
        ? null
        : this.record.created_date
    }
  
    set createdDate(value) {
      this.record.created_date = value
    }
  
    get updatedDate() {
      return this.record.updated_date === undefined
        ? null
        : this.record.updated_date
    }
  
    set updatedDate(value) {
      this.record.updated_date = value
    }
  }
  
  module.exports = Record
  